package com.iflytek.config;

import com.iflytek.interceptor.FirstInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer {
    //此方法可以将新的拦截器添加到SpringMVC框架中
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new FirstInterceptor())      //添加拦截器到拦截器链
                .addPathPatterns("/submitOrder")                         //指定该拦截器拦截哪些访问
        ;              //排除部分访问路径不拦截

    }
}
